<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__//Css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__//Css/bootstrap-responsive.css"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__//Css/style.css"/>
    <script type="text/javascript" src="__PUBLIC__//Js/jquery.js"></script>
    <script type="text/javascript" src="__PUBLIC__//Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="__PUBLIC__//Js/bootstrap.js"></script>
    <script type="text/javascript" src="__PUBLIC__//Js/ckform.js"></script>
    <script type="text/javascript" src="__PUBLIC__//Js/common.js"></script>

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }

        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>

<div class="navbar definewidth m10">
    <div class="navbar-inner">
        <a class="brand">角色列表</a>
        <button style="float:right" type="button" class="btn btn-success" id="addnew">添加角色</button>
    </div>
</div>

<table class="table table-bordered table-hover definewidth m10">
    <thead>
    <tr>
        <th width="5%">序号</th>
        <th width="15%">角色名称</th>
        <th width="15%">文档权限</th>
        <th width="15%">分类权限</th>
        <th width="15%">留言权限</th>
        <th width="15%">用户权限</th>
        <th width="10%">操作</th>
    </tr>
    </thead>
    <volist name="list" id="vo">
        <tr>
            <td>{$vo.id}</td>
            <td>{$vo.name}</td>
            <td>
                <php> echo $p1[$vo[doclevel]]</php>
            </td>
            <td>
                <php> echo $p1[$vo[classlevel]]</php>
            </td>
            <td>
                <php> echo $p2[$vo[messlevel]]</php>
            </td>
            <td>
                <php> echo $p1[$vo[memblevel]]</php>
            </td>
            <td>
                <button type="button" class="btn btn-mini btn-info" id="addnew" onclick="javasript:edit({$vo.id})">编辑
                </button>
                <button type="button" class="btn btn-mini btn-danger" id="addnew" onclick="javasript:del({$vo.id})">删除
                </button>
            </td>
        </tr>
    </volist>
</table>
</body>
</html>

<script>
    $(function () {

        $('#addnew').click(function () {

            window.location.href = "{:U('Admin/Role/add')}";
        });


    });

    function edit(id) {
        window.location.href = "{$editurl}?id=" + id;
    }
    function del(id) {
        if (confirm("确定要删除吗？")) {
            window.location.href = "{$delurl}?id=" + id;
        }
    }
</script>